<template>
  <div id="app" style="height:100%;" :class="isShowSide ? 'active' : ''">
    <router-view v-if="isRouterAlive"/>
  </div>
</template>

<script>
export default {
  name: "App",
  provide () {
    return {
      reload: this.reload
    }
  },
  computed: {
    isShowSide() {
      return this.$store.state.im.isShowSide;
    }
  },
  data(){
    return{
      isRouterAlive: true
    }
  },
  updated () {
    // 提交sdk连接请求
    this.$store.dispatch('im/connect')
    this.$store.dispatch('im/updateRefreshState')
  },
  methods:{
    reload () {
      this.isRouterAlive = false
      this.$nextTick(function () {
        this.isRouterAlive = true
      })
    }
  }
};
</script>

<style lang= "less">
   @import './assets/css/reset.css';
   .active {
     
     .content {
      left: 0!important;
      transition: all 0.5s;
     }
     
   }
</style>
